Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entries in docker node ps when multi nodes are passed #5314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ehsan-salamati
Copy link

@ehsan-salamati ehsan-salamati commented Aug 2, 2024

- What I did
Fixes #4155 duplicate entries in docker node ps when multi nodes are passed

- How I did it
When running the docker node ps command with multiple nodes in the for loop, the filter state retains node-specific data from previous iterations, causing task entries to be duplicated for the first specified node. This occurs because the filter object, being a dictionary type, was reused and modified across iterations, accumulating previous node filters.
- How to verify it

  1. Added a unit test for this case.
  2. Created a multi-node cluster and pass in multiple nodes to the docker node ps command.
    Before:
    image
    After :
    image

- Description for the changelog

Fixed duplicate entries in `docker node ps` cmd when multiple nodes are passed.

- A picture of a cute animal (not mandatory but encouraged)

@ehsan-salamati ehsan-salamati force-pushed the 4155-fix-docker-node-ps-duplicate-enteries-for-multi-nodes-passed branch from 08cb5ca to 274d087 Compare August 2, 2024 14:23
…. For example, 'docker ps node node1 node2'.

Signed-off-by: Ehsan Salamati <[email protected]>
@ehsan-salamati ehsan-salamati force-pushed the 4155-fix-docker-node-ps-duplicate-enteries-for-multi-nodes-passed branch from 274d087 to 94b0eb8 Compare August 2, 2024 14:24
@ehsan-salamati ehsan-salamati marked this pull request as ready for review August 2, 2024 14:37
@ehsan-salamati ehsan-salamati changed the title fixes 4155: duplicate entries in docker node ps when multi nodes are passed Duplicate entries in docker node ps when multi nodes are passed Aug 2, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.45%. Comparing base (ddd4c39) to head (94b0eb8).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5314   +/-   ##
=======================================
  Coverage   61.45%   61.45%           
=======================================
  Files         299      299           
  Lines       20855    20855           
=======================================
  Hits        12816    12816           
  Misses       7124     7124           
  Partials      915      915           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker node ps with multiple nodes duplicates entries for the first node specified
2 participants